package com.yunji.ylexpiration_backstage.service.impl;

import com.yunji.ylexpiration_backstage.entity.FurnCommodity;
import com.yunji.ylexpiration_backstage.mapper.FurnCommodityMapper;
import com.yunji.ylexpiration_backstage.service.FurnCommodityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class FurnCommodityServiceImpl implements FurnCommodityService {
    @Autowired
    private FurnCommodityMapper furnCommodityMapper;

    @Override
    public List<FurnCommodity> selectBysalesnumByLimit10() {
        List<FurnCommodity> furnCommodities = furnCommodityMapper.selectBysalesnumByLimit10();
        if(furnCommodities==null||furnCommodities.size()==0){
            return null;
        }
        return furnCommodities;
    }

    @Override
    public List<FurnCommodity> getAll(String productname) {
        List<FurnCommodity> all = furnCommodityMapper.getAll(productname);
        if(all==null||all.size()==0){
            return null;
        }
        return all;
    }

    @Override
    public int deletebatches(Integer[] id) {
        int deletebatches = furnCommodityMapper.deletebatches(id);
        return deletebatches;
    }
}
